<?php

namespace Application;

use Exception;

class Config
{
    const CONFIG = '../config/application.config.php';
    private static $instance;

    public static function getInstance()
    {
        if (null === self::$instance) {
            if (!file_exists(self::CONFIG) || !(self::$instance = include(self::CONFIG))) {
                throw new Exception('Cannot read configuration');
            }
        }
        return self::$instance;
    }
}
